<template>
<div>

    <van-nav-bar title="会议室申请详情" left-text="返回" right-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight" />

    <tabbar title="会议室申请"></tabbar>
    <van-form @submit="onSubmit">
        <van-field name="id" v-model="id" label="申请单号" readonly />
        <van-field name="applyTime" v-model="applyTime" label="申请时间" readonly />
        <van-field name="applyPern" v-model="applyPern" label="申请人" readonly />
        <van-field name="applyDept" v-model="applyDept" label="申请部门" readonly />
        <van-field name="applyDept" v-model="meetingName" label="会议主题" readonly />
        <van-field name="applyDept" v-model="meetingRoom" label="会议室" readonly />
        <van-field name="applyDept" v-model="starttime" label="开始时间" readonly />
        <van-field name="applyDept" v-model="endtime" label="结束时间" readonly />
        <van-field name="applyDept" v-model="peoperNumber" label="参加人数" readonly />
        <van-field name="applyDept" v-model="meetingType" label="会议类型" readonly />
        <van-field name="applyDept" v-model="hostUnit" label="主办单位" readonly />
        <van-field name="applyDept" v-model="inResroom" label="室内资源" readonly />
        <van-field name="applyDept" v-model="outResroom" label="室外资源" readonly />

        <div style="margin: 16px;">
            <!-- <van-button round block type="info" native-type="submit">
                提交
            </van-button> -->
            <!-- <van-button round block type="info" @click="handleSumbit">
                提交
            </van-button> -->
        </div>
    </van-form>
</div>
</template>

<script>
import {
    ADD_FILE_TYPE
} from '@/api/fy';
export default {
    name: '',
    components: {},
    props: {},
    data() {
        return {
            id: '000',
            applyTime: "2020-03-26",
            applyPern: "",
            applyDept: "",
            hostUnit: "",
            peoperNumber: "",
            inResroom: [],
            outResroom: [],
            starttime: "", //开始时间
            starttime1: "", //开始时间时间戳
            endtime: "", //结束时间
            endtime1: "", //结束时间时间戳
            meetingType: "",
            meetingName: '',
        };
    },
    created() {
        this.applyPern = sessionStorage.getItem("account")
    },
    methods: {
        onClickLeft() {
            this.$router.go(-1); //返回上一层
        },
        onClickRight() {

        },
        handleSumbit() {
            const obj = {
                name: this.name
            }

            ADD_FILE_TYPE(obj).then(res => {

            })

        },

        onConfirm1(e) {
            this.value1 = e
            this.showPicker = false
        },
        onConfirm2(e) {
            this.value2 = e
            this.showPicker = false
        },
        onConfirm3(e) {
            this.value3 = e
            this.showPicker = false
        },
        mqinAi1() {
            this.myIf1 = true
            this.myIf2 = false
            this.myIf3 = false
            this.myIf4 = false
            this.myIf5 = false
            this.showPicker = true
        },
        mqinAi2() {
            this.myIf1 = false
            this.myIf2 = true
            this.myIf3 = false
            this.myIf4 = false
            this.myIf5 = false
            this.showPicker = true
        },
        mqinAi3() {
            this.myIf1 = false
            this.myIf2 = false
            this.myIf3 = true
            this.myIf4 = false
            this.myIf5 = false
            this.showPicker1 = true
        },
        mqinAi4() {
            this.myIf1 = false
            this.myIf2 = false
            this.myIf3 = false
            this.myIf4 = true
            this.myIf5 = false

            this.showPicker2 = true
        },

        mqinAi5() {
            this.myIf1 = false
            this.myIf2 = false
            this.myIf3 = false
            this.myIf4 = false
            this.myIf5 = true
            this.showPicker = true
        },

        onSubmit(values) {
            console.log('submit', values);
        },
        start() {
            this.show = true;
        },
        // 选择结束时间
        end() {
            this.show1 = true;
        },
        // 点击确定
        confirm() {
            this.show = false;
            this.starttime =
                this.currentDate.getFullYear() +
                "年" +
                (Number(this.currentDate.getMonth()) + 1) +
                "月" +
                this.currentDate.getDate() +
                "日 " +
                this.currentDate.getHours() +
                ":" +
                this.currentDate.getMinutes();
            this.starttime1 = new Date(this.currentDate).getTime() / 1000;
        },
        // 点击取消
        cancel() {
            this.show = false;
        },
        confirm1() {
            this.show1 = false;
            this.endtime =
                this.currentDate1.getFullYear() +
                "年" +
                (Number(this.currentDate1.getMonth()) + 1) +
                "月" +
                this.currentDate1.getDate() +
                "日 " +
                this.currentDate1.getHours() +
                ":" +
                this.currentDate1.getMinutes();
            this.endtime1 = new Date(this.currentDate1).getTime() / 1000;
        },
        cancel1() {
            this.show1 = false;
        },
        // 处理控件显示的时间格式
        formatter(type, value) {
            // 格式化选择器日期
            if (type === "year") {
                return `${value}年`;
            } else if (type === "month") {
                return `${value}月`;
            } else if (type === "day") {
                return `${value}日`;
            } else if (type === "hour") {
                return `${value}时`;
            } else if (type === "minute") {
                return `${value}分`;
            }
            return value;
        }
    },
};
</script>
